package com.kizuki.controllor;

import com.kizuki.design.wrapper.*;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class WrapperController {

    /**
     * 类似于jdk io流
     * 本质是对自身的增强
     * @param message
     * @return
     */
    @GetMapping("/wrapper/{message}")
    public String wrapper(@PathVariable String message){
        Notifier notifier = new QQWrapper(new WechatWrapper(new SmsWrapper(new BaseNotifier())));
        notifier.send(message);
        return "success";
    }
}
